package com.glodon.paas.account.user.dao;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.glodon.paas.account.api.bean.AccountConstant;
import com.glodon.paas.account.dao.domain.UserEntity;
import com.glodon.paas.account.dao.mysql.UserDaoMysqlImpl;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(value = {
		"classpath:test-account-load-property.xml",
		"classpath:paas-account-dao-mysql.xml"		
		})
public class UserDaoMysqlImplIT {

	private Md5PasswordEncoder md5PasswordEncoder;
	
	@Autowired
	private UserDaoMysqlImpl userDao;
	
	@Before
	public void setUp() throws Exception {
		md5PasswordEncoder = new Md5PasswordEncoder();
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void insert() {
//		UserEntity entity = new UserEntity();
//		for(int i=1; i<2;i++){
//			String email = i+"a@test.com";
//			String id=md5PasswordEncoder.encodePassword(email, null);
//			String password="111111";
//			password = md5PasswordEncoder.encodePassword(password, null);
//			entity.setEmail(email);
//			entity.setId(id);
//			entity.setPassword(password);
//			entity.setStatus(AccountConstant.USER_STATUS_ACTIVE);
//			userDao.insert(entity);
//		}	

	}
	
	

}
